package cn.stard.org.domain;

import cn.stard.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class DePartment extends BaseDomain {

    // 部门管理员
    private Long managerId;
    // 上级部门Id
    private Long parentId;
    private Integer   state;
    private String dirPath;
    private String  name;
    private String sn;
    // 添加部门经理对象字段
    private Employee manager;
    // 添加上级部门对象字段
    private DePartment parent;

    // 封装子部门集合字段
    @JsonInclude(JsonInclude.Include.NON_EMPTY) // 当数据不为空的时候才返回
    private List<DePartment> children = new ArrayList<>();
}
